﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RedDragon.Common.Domain.MaterialManagements
{
    /// <summary>
    /// 物料类别
    /// </summary>
    [SugarTable("MaterialCategory")]
    public class MaterialCategory
    {
        /// <summary>
        /// 物料类别ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//IsPrimaryKey 主键 IsIdentity 自增
        public int MaterialCategoryId { get; set; }
        /// <summary>
        /// 类别名称
        /// </summary>
        [SugarColumn(ColumnDataType = "Nvarchar(50)")]//设置长度
        public string? MaterialCategoryName { get; set; }
        /// <summary>
        /// 父级ID
        /// </summary>
        public int? PId { get; set; }
        /// <summary>
        /// 是否删除 1-未删除；2-删除
        /// </summary>
        public int? IsDel { get; set; }
        /// <summary>
        /// 子级
        /// </summary>
        [SugarColumn(IsIgnore = true)] //IsIgnore 被忽略 不会迁移到数据库
        public List<MaterialCategory> Children { get; set; }
    }
}
